<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML >
<html lang="en">
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>用户管理.jsp</title>


<script type="text/javascript" src="qiang/zgq/js/jquery-1.8.3.js"></script>

<link rel="stylesheet" href="qiang/zgq/css/cal.css"  type="text/css" />
<script src="qiang/zgq/js/cal.js" type="text/javascript" charset="gbk"></script>




<script type="text/javascript">
	$(function(){
		$("table tr:odd").css("background-color","#FFFFFF");
		var str="";
		/* $.post(
			"findAllDept.action",
			function(data){
				var list=data.listdeDepts;
				if(data.listdeDepts.length>0){
					for(var i=0;i<list.length;i++){
						str+="<option value='"+list[i].id+"'>"+list[i].dname+"</option>";
					};
					$("#dept").append(str);
				}
			},
			"json"
		); 
		$.post(
			"findAllJueSe.action",
			function(data){
				var list=data.listjJueses;
				if(list.length>0){
					for(var i=0;i<list.length;i++){
						str+="<option value='"+list[i].id+"'>"+list[i].jname+"</option>";
					};
					$("#juese").append(str);
				}
			},
			"json"
		); */
	});
</script>

<style type="text/css">
	#t_1 .td1{width: 107px;height: 18px;}
	#t_1 .td2 input{width: 124px;height: 18px;}
	#t_1 .td3{width: 146px;height: 18px;}
	#t_1 .td4{width: 231px;height: 18px;}
	#t_1 .td5 input{width: 165px;height: 18px;}
	
	#page li{float: left;padding-left: 5px;}
</style>

</head>

<body>
	<div id="all"
		style="width:1050px ;height: 2000px;background-color: #C9C9C9;margin: 0 auto;position:relative;top:30px;">
		<div id="header"
			style="width: 1030px; height:100px;position:absolute;left: 10px;top:0px;background-color:white;">
			<%@ include file="header.jsp"%>
		</div>
		<div id="left"
			style="height: 1000px;width: 200px; position:absolute;left: 10px;top:100px;background-color:white;">
			<%@ include file="left_use.jsp"%>
		</div>
		<div id="right"
			style="height: 1000px;width: 810px; ;position:absolute;left: 230px;top:100px;
			background-color:#F4F4F4;">
			<div id="h11" style="width:782px;">
				<div style="margin-top: 10px;margin-left: 22px;font-size: 14px;">
						<span>系统设置</span> <span>>></span> <span><a>用户管理</a>
						</span>
					</div>
            	 <div>
            	 <form action="findUsersByCondition" method="post">
                	<table style="margin-left: 22px;margin-top: 10px;font-size: 14px;border: none;">
                    <tr>
                    <td>
                    	用户名称：
                        <input type="text" name="username" value="${username}"/>
                    </td>
                    <td>
                    	用户角色：
                        <select name="jueseId" id="juese">
                        	<option value="0">--请选择--</option>
                        	<c:forEach items="${listjJueses}" var="i">
                        		<option <c:if test="${i.id==jueseId}">selected</c:if> value="${i.id}">${i.jname}</option>
                        	</c:forEach>
                    	</select>
                    </td>
                    <td>
                    所属部门:			
                    	<select name="deptId" id="dept">
                        	<option value="0">--请选择--</option>
                        	<c:forEach items="${listdeDepts}" var="i">
                        		<option <c:if test="${i.id==deptId}">selected</c:if> value="${i.id}">${i.dname}</option>
                        	</c:forEach>
                    	</select>
                    
                    </td>
                   	
                  			 <td>
                            <input type="submit" value="查询"/>
                            </td>
                    </tr>
                    </table>
                </form>
                </div>
                
                <div style="margin-left: 22px;">
                	<input type="button" id="xinZeng" value="新增用户"/>
                </div>
                
                <div style="margin-top: 10px;margin-left: 22px;">
                
                <table id="t_1" style="text-align: center;">
               			<tr style="font-size: 14px;font-weight: bolder;">
                        	<td class="td1">用户编码</td>
                        	<td class="td2">用户名称</td>
                            <td class="td3">用户角色</td>
                            <td class="td4">所属部门</td>
                            <td class="td5">操作</td>
                        </tr>
               			<c:forEach items="${listuUsers}" var="l">
	                        <tr>
	                        	<td class="td1">${l.code}</td>
	                        	<td class="td2">${l.username}</td>
	                            <td class="td3">${l.juese.jname}</td>
	                            <td class="td4">${l.dept.dname}</td>
	                            <td class="td5"><a href="findUserById?mingXi=0&id=${l.id}">修改</a>&nbsp;&nbsp;
	                            <a href="findUserById?mingXi=1&id=${l.id}">明细</a>&nbsp;&nbsp;
	                            <a href="delUsers?id=${l.id}">删除</a></td>
	                        </tr>
                      </c:forEach>  
               </table>
                
		<div style="width: 300px;margin-left: 240px;margin-top: 10px;">
                    	<script type="text/javascript">
                    		$(function(){
                    			$("#page").click(function(){
                    				//alert($("#hid").val());
                    			});
                    			$("#sele").click(function(){
                    				//alert("123");
                    			});
                    			
                    			$("#xinZeng").click(function(){
                    				window.location.href="findAllJueSe";
                    			});
                    		});
                    	</script>
                    	<input type="hidden" value="${page}" id="hid"/>
						<ul id="page">
						    <li><a href="findUsersByCondition?page=${page-1}">&laquo;</a></li>
						    <li><a href="findUsersByCondition?page=1">1</a></li>
						    <li><a href="findUsersByCondition?page=2">2</a></li>
						    <li><a href="findUsersByCondition?page=3">3</a></li>
						    <li><a href="findUsersByCondition?page=4">4</a></li>
						    <li><a href="findUsersByCondition?page=5">5</a></li>
						    <li><a href="findUsersByCondition?page=6">6</a></li>
						    <li><a href="findUsersByCondition?page=7">7</a></li>
						    <li><a href="findUsersByCondition?page=8">8</a></li>
						    <li><a href="findUsersByCondition?page=9">9</a></li>
						    <li><a href="findUsersByCondition?page=10">10</a></li>
						    <li><a href="findUsersByCondition?page=${page+1}">&raquo;</a></li>
						    <li><input type="text" value="" id="go" size="2" style="height: 20px;"/></li>
						    <li><input type="button" value="Go" onclick="backGo()"/></li>
						</ul>
						
                    </div>
                    <script type="text/javascript">
                    		function backGo(){
                    		var id=$("#go").val();
                    		window.location.href="findUsersByCondition?page="+id;
                    	};
                    </script>
                <div style="width: 200px;margin-left: 260px;margin-top: 10px;">
					<h1>${message}</h1>
				</div>   
		
		
		
		
		</div>
		</div>
		</div>
	</div>

</body>
</html>
